package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcCourseType;
import com.visizen.wisdomclass.server.model.WcCourseTypeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcCourseTypeMapper {
    @SelectProvider(type=WcCourseTypeSqlProvider.class, method="countByExample")
    int countByExample(WcCourseTypeExample example);

    @DeleteProvider(type=WcCourseTypeSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcCourseTypeExample example);

    @Delete({
        "delete from wc_course_type",
        "where COURSE_ID = #{COURSE_ID,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String COURSE_ID);

    @Insert({
        "insert into wc_course_type (COURSE_ID, NAME)",
        "values (#{COURSE_ID,jdbcType=VARCHAR}, #{NAME,jdbcType=VARCHAR})"
    })
    int insert(WcCourseType record);

    @InsertProvider(type=WcCourseTypeSqlProvider.class, method="insertSelective")
    int insertSelective(WcCourseType record);

    @SelectProvider(type=WcCourseTypeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="COURSE_ID", property="COURSE_ID", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="NAME", property="NAME", jdbcType=JdbcType.VARCHAR)
    })
    List<WcCourseType> selectByExample(WcCourseTypeExample example);

    @Select({
        "select",
        "COURSE_ID, NAME",
        "from wc_course_type",
        "where COURSE_ID = #{COURSE_ID,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="COURSE_ID", property="COURSE_ID", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="NAME", property="NAME", jdbcType=JdbcType.VARCHAR)
    })
    WcCourseType selectByPrimaryKey(String COURSE_ID);

    @UpdateProvider(type=WcCourseTypeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcCourseType record, @Param("example") WcCourseTypeExample example);

    @UpdateProvider(type=WcCourseTypeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcCourseType record, @Param("example") WcCourseTypeExample example);

    @UpdateProvider(type=WcCourseTypeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcCourseType record);

    @Update({
        "update wc_course_type",
        "set NAME = #{NAME,jdbcType=VARCHAR}",
        "where COURSE_ID = #{COURSE_ID,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(WcCourseType record);
}